package com.study.group.modules.mongo.dao.impl;

import com.study.group.common.entrty.Person;
import com.study.group.modules.mongo.abs.AbstractMongoRepository;
import com.study.group.modules.mongo.dao.PersonDao2;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @Description 类描述
 * @Author      yanghanwei
 * @Mail        yanghanwei@geotmt.com
 * @Date        2019/4/28 15:10
 * @Version     v1
 **/
@Repository
public class PersonDao2Impl extends AbstractMongoRepository<Person> implements PersonDao2 {

    @Override
    protected Class<Person> getEntityClass() {
        return Person.class;
    }

    @Override
    public List<Person> listAll() {
        this.queryList(new Person());
        return this.getPage(new Person(),1,2);
    }

    @Override
    public Person saveP(Person person) {
        Person per = new Person("name",13,"人妖");
        return this.save(per);
    }

    @Override
    public List<Person> getByName(String name) {
        Person person = new Person();
        person.setName("孙悟空");
        return this.queryList(person);
    }

}
